package com.es.www.simpleFactory;

import java.text.SimpleDateFormat;
import java.util.Objects;
import java.util.Scanner;

/**
 * @Created by michangtao
 * @Date 2022/5/10 19:28
 * @Description
 */
public class Store {

    public void orderPizza() {
        do {
            String pizzaType = getType();
            Pizza pizza = SimpleFactory.createPizza(pizzaType);
            if(pizza !=null) {
                pizza.prePare();
                pizza.bake();
                pizza.cut();
                pizza.box();
            }
        }
        while (true);
    }


    private String getType() {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要购买的pizza种类：");
        return sc.nextLine();
    }

    public static void main(String[] args) {
        Store store = new Store();
        store.orderPizza();
    }
}
